@echo off
REM 定义下载目录
set "DOWNLOAD_DIR=%CD%\downloaded_files"

REM 创建下载目录
mkdir "%DOWNLOAD_DIR%"

REM 下载文件列表页面
echo Fetching file list from the URL...
curl -o file_list.html "https://sid.erda.dk/cgi-sid/ls.py?share_id=GxrFNGtykS"

REM 检查是否找到 .md5 文件
findstr /i ".md5" file_list.html >nul
if %errorlevel% equ 0 (
    echo MD5 checksum file found on the server.
) else (
    echo No MD5 checksum file found on the server.
)

REM 下载所有文件（递归下载并保留目录结构）
echo Starting download of all files and folders...
wget -r -np -nH -P "%DOWNLOAD_DIR%" "https://sid.erda.dk/cgi-sid/ls.py?share_id=GxrFNGtykS"

REM 提示完成
echo Download and verification process completed. Check the %DOWNLOAD_DIR% folder.
pause
